package com.runshu.newsmartark.entity;

import android.content.Context;

import com.runshu.newsmartark.base.MyApplication;
import com.runshu.newsmartark.util.common.SharedPreferencesUtils;

/**
 * Demo class
 *
 * @author yu
 * @date 2021/11/17
 * @decs：
 */

public class HwInfoUtils {
    private static String customerId = "customerId";  //
    private static String hospitalId = "hospitalId";  //hospitalId
    private static String hwId = "hwId";
    private static String hospitalName = "hospitalName";
    private static String hwCode = "hwCode";



    public static void saveData(Context context, final HDInfoBean hdInfoBean) {
        if (hdInfoBean.getCustomerId() != null) {
            SharedPreferencesUtils.put(context, customerId, hdInfoBean.getCustomerId());
        }
        if (hdInfoBean.getHospitalId() != null) {
            SharedPreferencesUtils.put(context, hospitalId, hdInfoBean.getHospitalId());
        }
        if (hdInfoBean.getId() != null) {
            SharedPreferencesUtils.put(context, hwId, hdInfoBean.getId());
        }
        if (hdInfoBean.getHospitalName() != null) {
            SharedPreferencesUtils.put(context, hospitalName, hdInfoBean.getHospitalName());
        }
        if (hdInfoBean.getHwCode() != null) {
            SharedPreferencesUtils.put(context, hwCode, hdInfoBean.getHwCode());
        }
    }


    public static String getHospitalName(Context context) {
        return (String) SharedPreferencesUtils.get(context, hospitalName, "");
    }

    public static void setHospitalName(String hospitalName) {
        SharedPreferencesUtils.put(MyApplication.getApplication(), hospitalName, hospitalName);
    }

    public static String getHwCode(Context context) {
        return (String) SharedPreferencesUtils.get(context, hwCode, "");

    }

    public static void setHwCode(String hwCode) {
        SharedPreferencesUtils.put(MyApplication.getApplication(), hwCode, hwCode);
    }


    public static String getHwId(Context context) {
        return (String) SharedPreferencesUtils.get(context, hwId, "");

    }

    public static void setHwId(String hwId) {
        SharedPreferencesUtils.put(MyApplication.getApplication(), hwId, hwId);
    }

    public static String getCustomerId(Context context) {
        return (String) SharedPreferencesUtils.get(context, customerId, "");
    }

    public static void setCustomerId(String customerId) {
        SharedPreferencesUtils.put(MyApplication.getApplication(), customerId, customerId);

    }

    public static String getHospitalId(Context context) {
        return (String) SharedPreferencesUtils.get(context, hospitalId, "");

    }

    public static void setHospitalId(String hospitalId) {
        SharedPreferencesUtils.put(MyApplication.getApplication(), hospitalId, hospitalId);
    }
}